package cn.iocoder.yudao.module.trade.scan.vo;

import cn.iocoder.yudao.framework.business.order.pojo.dto.OrderSubmitDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/02/24
 */
@Schema(description = "线下扫码订单创建 VO")
@Data
@Valid
public class NewCustomerSubmitDTO extends OrderSubmitDTO {

    @Schema(description = "店铺编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "店铺编号不能为空")
    private Long shopId;

    @Schema(description = "应付金额，单位为分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
    @Min(value = 1, message = "应付金额必须大于等于 1")
    @NotNull(message = "应付金额不能为空")
    private Integer price;

    @Schema(description = "原价金额，单位为分", example = "100")
    @Min(value = 1, message = "原价金额必须大于等于 1")
    private Integer originPrice;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

    public Integer getOriginPrice() {
        if (originPrice == null) {
            originPrice = getPrice();
        }
        return originPrice;
    }

}
